import java.util.Arrays;

public class Test {
    public static void rule(int[] array) {
        for (int i = 0;i < array.length;i++){
            if (array[i] % 2 == 0){
                int a = array[i];
                array[i] = array[i+1];
                array[i+1] = a;
            }
        }
    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,6};
        rule(array);
        System.out.println(Arrays.toString(array));
    }
    public static void transform(int[] array) {//将数组中每个元素乘以2
        for (int i = 0;i < array.length;i++){
            array[i] = array[i]*2;
        }
    }

    public static void main1(String[] args) {
        int[] array = {1,2,3};
        transform(array);
        System.out.println(Arrays.toString(array));
    }
}
